


//
//  YZQPhotosCollectionViewCell.m
//  SuperNews
//
//  Created by qiang on 16/1/13.
//  Copyright © 2016年 qiang. All rights reserved.
//

#import "YZQPhotosCollectionViewCell.h"

@interface YZQPhotosCollectionViewCell ()
@property (nonatomic, retain) UIImageView *imageView;
@property (nonatomic, retain) NSString *imgurl;
@property (nonatomic, retain) NSString *note;
@end

@implementation YZQPhotosCollectionViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageView];
        self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.imageView.frame = CGRectMake(0, 100, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height / 2);
}

- (void)setDic:(NSDictionary *)dic
{
    if (_dic != dic) {
        _dic = dic;
    }
    self.imgurl = [dic objectForKey:@"imgurl"];
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:self.imgurl] placeholderImage:nil];
}

@end
